Issues repopulating List View

I'm writing a script that will display all modules within a folder and subfolder of the users' choice. I can populate my ListView dialog box element once, but I cannot seem to update the results or display new results when running the search on a different folder.

So far I've tried simply overriding the data in the exisiting rows and columns, but that just appends the information. I've also tried calling the empty(listView) method, as well as calling realize(Main_Dialog) after that as specified here.

I can still update the information in the first column after using the empty method, as such I've tried deleting the other columns and re-adding them, this has the same result as the empty() -> realize() calls.

Any help would be greatly appreciated.


jsjlewis - Mon Apr 03 06:37:57 EDT 2017

Re: Issues repopulating List View
Mathias Mamsch - Mon Apr 03 08:41:26 EDT 2017

It should work perfectly well to use 

empty(dbeMyListView)
// ...
for (...) {
    insert(dbeMyListView, ...) // reinsert the new elements
}

If you want to update single items inside the listview you can use: 

void set(DBE listView, int item, int column, string value)

You can of course also remove certain lines and reinsert them again. 

This has nothing to do with realize (which you need to call before inserting columns to the listview though). 

Regards, Mathias

 

Re: Issues repopulating List View
jsjlewis - Mon Apr 03 09:20:59 EDT 2017

Mathias Mamsch - Mon Apr 03 08:41:26 EDT 2017

It should work perfectly well to use 

empty(dbeMyListView)
// ...
for (...) {
    insert(dbeMyListView, ...) // reinsert the new elements
}

If you want to update single items inside the listview you can use: 

void set(DBE listView, int item, int column, string value)

You can of course also remove certain lines and reinsert them again. 

This has nothing to do with realize (which you need to call before inserting columns to the listview though). 

Regards, Mathias

 

Thanks for the speedy response, you were as ever correct :) Turns out I had forgotten to reset the item number to 0 when using 

void set(DBE listView, int item, int column, string value)

It's always the small things...